package com.hue.rabbitmq;

import com.hue.domain.User;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "object")   //监听的消息队列
public class UserReceiver {

    @RabbitHandler
    public void receiverObj(User user){
        System.out.println(user.getUsername());
        System.out.println(user.getPassword());
    }

}
